package com.itheima.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface OrderSettingMapper {

    //通过预约日期查询预约人数
    @Select("select number from t_ordersetting where orderDate=#{orderDate}")
    Integer findNumberByDate(String orderDate);


    //通过预约日期查询 已预约人数
    @Select("select reservations from t_ordersetting where orderDate=#{orderDate}")
    Integer findReservations(String orderDate);

    @Update("update t_ordersetting set reservations=reservations+1 where orderDate=#{orderDate}")
    void updataReservations(String orderDate);

    @Select("select count(reservations) from t_ordersetting where orderDate=#{orderDate}")
    Integer getReservations(String orderDate);
}
